<template>
  <div>
    <el-upload
      action="https://jsonplaceholder.typicode.com/posts"
      list-type="picture-card"
      :on-preview=" handlePictureCardPreview"
      :on-remove="handleRemove">
      <el-icon class="el-icon-plus"></el-icon>
    </el-upload>
    <el-dialog :visible.sync="dialogVisible">
      <img width="100%" :src="dialogImageUrl" alt="">
    </el-dialog>
  </div>
</template>

<script>
  export default {
    name: "config",
    data() {
      return {
        dialogImageUrl: '',
        dialogVisible: false
      }
    },
    methods: {
      handleRemove(file, fileList) {
        console.log(file, fileList);
      },
      handlePictureCardPreview(file) {
        this.dialogImageUrl = file.url;
        this.dialogVisible = true;
      }
    }
  }
</script>

<style scoped>

</style>
